home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 November / PCWorld_2006-11_cd.bin / domacnost a kancelar / easytime / ETT.exe / reports / xslt / DetailedTimesheetGroupByDay.xsl < prev    next >
Extensible Markup Language  |  2006-08-18  |  3KB  |  92 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     <xsl:output method="html" indent="yes"/>
  4.     <xsl:template match="/">
  5.         <html>
  6.             <head>
  7.                     <link rel="stylesheet" type="text/css" href="style.css"></link>
  8.             </head>
  9.             <xsl:apply-templates select="/Report/HeaderInfo"></xsl:apply-templates>
  10.             <xsl:apply-templates select="/Report/Date"></xsl:apply-templates>
  11.             <xsl:apply-templates select="/Report/Total"/>
  12.         </html>
  13.     </xsl:template>
  14.  
  15.     <!-- ╨Æ╨╡╤Ç╤à╨╜╨╕╨╣ ╨╖╨░╨│╨╛╨╗╨╛╨▓╨╛╨║  -->
  16.     <xsl:template match="HeaderInfo">
  17.         <table class="TableSB" align="center" width="90%">
  18.             <tr>
  19.                 <td>
  20.                     <table class="TableSB" width="100%" cellpadding="2" cellspacing="0" >
  21.                         <tr>
  22.                             <td colspan="2" align="center" class="ReportTitleClass"><xsl:value-of select="/Report/@Type"/></td>
  23.                         </tr>
  24.                         <xsl:if test="Date">  <!--╨ò╤ü╨╗╨╕ ╤Å╨▓╨╜╨╛ ╨▓╤ï╨▒╤Ç╨░╨╜ ╨┤╨╕╨░╨┐╨░╨╖╨╛╨╜ ╨┤╨░╤é  -->
  25.                             <tr>
  26.                                 <td colspan="2" align="right" class="Date"><xsl:value-of select="Date/From"/> - <xsl:value-of select="Date/To"/></td>
  27.                             </tr>
  28.                         </xsl:if>
  29.                     </table>
  30.                 </td>
  31.             </tr>
  32.         </table>
  33.     </xsl:template>
  34.  
  35.     <xsl:template match="Date">
  36.         <table align="center" width="90%">
  37.         <tr>
  38.             <td colspan="5" valign="top" class="DetailRowTitleClass"><xsl:value-of select="@Value"/></td>
  39.         </tr> 
  40.         <xsl:if test="position()=1">
  41.         <tr>
  42.             <td width="20%" class="DetailRowTitleClass">Company</td>
  43.             <td width="20%" class="DetailRowTitleClass">Project</td>
  44.             <td width="20%" class="DetailRowTitleClass">Task</td>
  45.             <td width="30%" class="DetailRowTitleClass">Description</td>
  46.             <td width="10%" class="DetailRowTitleClass">Hours</td>
  47.         </tr>
  48.         </xsl:if>
  49.         
  50.         <xsl:apply-templates select="Company"/>
  51.         <tr>
  52.             <td colspan="4" valign="top" class="SubTotal">Sub-total:</td>
  53.             <td valign="top" class="DetailRowDataClass1"><xsl:value-of select="SubTotal"/></td>
  54.         </tr>
  55.     </table>
  56.     </xsl:template>
  57.  
  58.     <xsl:template match="Company">
  59.     <tr>
  60.         <td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Name"/></td>
  61.         <td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Project"/></td>
  62.         <td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Task"/></td>
  63.         <td width="30%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Description"/></td>
  64.         <td width="10%" valign="top" class="DetailRowDataClass1"><xsl:value-of select="Hours"/></td>
  65.     </tr>
  66.     </xsl:template>
  67.  
  68.     <xsl:template match="Companies/Company">
  69.         <xsl:value-of select="text()"/>
  70.         <xsl:if test="following-sibling::*/text()">, </xsl:if>
  71.     </xsl:template>
  72.  
  73.     <xsl:template match="Projects/Project">
  74.         <xsl:value-of select="text()"/>
  75.         <xsl:if test="following-sibling::*/text()">, </xsl:if>
  76.     </xsl:template>
  77.  
  78.     <xsl:template match="Tasks/Task">
  79.         <xsl:value-of select="text()"/>
  80.         <xsl:if test="following-sibling::*/text()">, </xsl:if>
  81.     </xsl:template>
  82.  
  83.      <xsl:template match="/Report/Total">
  84.      <table align="center" width="90%">
  85.         <tr>
  86.             <td width="90%" class="Total">Total:</td>
  87.             <td class="Total"><xsl:value-of select="text()" /></td>
  88.        </tr>
  89.     </table>
  90.     </xsl:template>
  91.  
  92. </xsl:stylesheet>